
import org.jsoup.*;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.*;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import org.sqlite.*;



/**
 * @author belgaied
 *
 */
public class RecupHTML {
	
	static Elements alphaMangaList;
		
	public static void main(String[] args) {
		System.out.println("Alive !");
		MangaPage mPage = new MangaPage("http://mangafox.me/manga/ge/v18/c155/2.html");
		System.out.println("L'url de la page image est :"+mPage.pageImageUrl);
		System.out.println("Le numéro de la page est :"+mPage.mangaPageNumber);
		System.out.println("Le numéro du volume de la page est :"+mPage.volumeNumber);

	}
	
	
	static Element alphaMangaList (int i) {
		 return alphaMangaList.get(i);
	}
	
	static Element currMangaElement(int i , int j){
		return alphaMangaList(i).getElementsByTag("LI").get(j);
	}
	
	static java.sql.Connection db_connection (String dbName) throws Exception {
		return DriverManager.getConnection("jdbc:sqlite:"+dbName);
	}
	
	static void dbStatement (java.sql.Connection db, String statement) {
		try {
			Statement stat = db.createStatement();
			stat.executeUpdate(statement);
			db.close();
		} catch(Exception e){
			System.out.println("Corriger la requéte suivante :\n "+statement);
		};
	}
}

